<template>
	<view>
		<u-navbar class="custom-header" back-text="返回" title="盘点库存-明盘" height="44">
			<view slot="right"><u-button type="primary" size="mini" style="margin-right: 20rpx;" @click="handleSave">保存</u-button></view>
		</u-navbar>
		<view class="text">盘库单基本信息</view>
		<uni-card>
			<u-form labelPosition="left" :model="model" ref="uForm" label-width="200rpx">
				<u-form-item label="盘库单号:" prop="danhao" borderBottom><u-input v-model="model.danhao" placeholder="保存后系统自动生成" :border="border"></u-input></u-form-item>
				<u-form-item label="盘库单名称:" prop="mingchen" borderBottom>
					<u-input v-model="model.mingchen" placeholder="请输入盘库单名称" :border="border"></u-input>
				</u-form-item>
				<u-form-item label="盘库日期:" prop="time" borderBottom>
					<u-input v-model="model.time" placeholder="请选择日期" :border="border" type="select" @click="show = true"></u-input>
					<u-picker v-model="show" mode="time" :params="params" @confirm="confirm2"></u-picker>
				</u-form-item>
				<u-form-item label="盘库人员:" prop="mingchen" borderBottom><u-input v-model="model.mingchen" placeholder="" :border="border"></u-input></u-form-item>
				<u-form-item label="盘库结果:" prop="mingchen" borderBottom><u-input v-model="model.mingchen" placeholder="" :border="border"></u-input></u-form-item>
			</u-form>
		</uni-card>
		<u-gap height="20" bg-color="#dedede"></u-gap>
		<view class="text">盘库明细信息</view>
		<u-row gutter="32" justify="center">
			<u-col span="10">
				<view><u-button type="success" @click="navTo('/pages/sys/home/components/work_bench/inventory_verification_bright_add')">新增</u-button></view>
			</u-col>
		</u-row>
		<uni-list>
			<uni-list-item v-for="(workReport, index) in workList" :key="index">
				<template slot="body">
					<uni-card is-full class="uni-list-card" padding="0" spacing="0">
						<view class="list-item-content">
							<view class="list-item-body">
								<view class="item-label">产品：</view>
								<view class="u-line-1 item-value">{{ workReport.itemName }}</view>
							</view>
							<view class="list-item-body">
								<view class="item-label">在库数量：</view>
								<view class="u-line-1 item-value">{{ workReport.quantityQualified }}</view>
							</view>
							<view class="list-item-body">
								<view class="item-label">安全库存：</view>
								<view class="u-line-1 item-value">{{ workReport.quantityUnquanlified }}</view>
							</view>
							<view class="list-item-body">
								<view class="item-label">所在位置：</view>
								<view class="u-line-1 item-value">{{ workReport.createTime }}</view>
							</view>
						</view>
					</uni-card>
				</template>
			</uni-list-item>
		</uni-list>
		<u-row gutter="32" class="bottom-box" justify="center">
			<u-col span="10">
				<view><u-button type="primary" shape="circle" @click="navTo('/pages/sys/home/index')">开始盘点</u-button></view>
			</u-col>
		</u-row>
	</view>
</template>

<script>
export default {
	data() {
		return {
			model: {
				danhao: '',
				mingchen: '',
				gys: '',
				cgdh: '',
				jcdh: '',
				time: ''
			},
			border: false,
			show: false,
			params: {
				year: true,
				month: true,
				day: true
			},
			workList: [{ itemName: 1, quantityQualified: 2, quantityUnquanlified: 3, createTime: 4 }],
			listType: [
				{
					name: '内部转移',
					disabled: false
				},
				{
					name: '外部转移',
					disabled: false
				}
			],
			value: 'orange'
		};
	},
	methods: {
		handleSave() {},
		confirm1(e) {
			console.log(e);
			this.model.gys = e[0].label;
		},
		confirm2(e) {
			console.log(e);
		},
		navTo(url) {
			console.log(111);
			uni.navigateTo({
				url: url
			});
		},
		radioGroupChange(e) {
			console.log(e);
		},
		radioChange(e) {
			console.log(e);
		}
	}
};
</script>

<style scoped lang="scss">
.text {
	font-weight: bold;
	text-align: center;
	margin: 20rpx 0;
}
</style>
